from pydantic import ConfigDict

from app.models.base import SQLBaseModel, IdType
from app.models.dict import BaseDict
from app.utils.decorators.optional import optional


class DictCreate(BaseDict):
    dict_type_id: IdType


@optional(without_fields=["id"])
class DictUpdate(DictCreate):
    id: IdType


class DictOut(SQLBaseModel, DictCreate):
    model_config = ConfigDict(from_attributes=True)

class DictExport(DictOut):
    model_config = ConfigDict(from_attributes=True)
